function [E,V,like,ll] = mvnfilter(Y,H,E,V,Q)

S = H*V*H' + Q;
S = (S + S')./2;
Si = S \ eye(size(S));

d = Y - H*E;

like = mvnpdf(Y,H*E,S);
if nargout==4
    if like==0
        logdetS = 2*sum(log(diag(chol(S))));
        ll = -.5*(logdetS + d'*Si*d + numel(Y)*log(2*pi));
    else
        ll = log(like);
    end
end

K = V*H'*Si;
E = E + K*d;
V = (eye(size(V)) - K*H)*V;
V = (V + V')./2;
